<script setup lang="ts">
import { useRouter } from "vue-router";

const router = useRouter();

const goBack = () => {
  router.back();
};

const goHome = () => {
  router.push("/");
};
</script>

<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <h1 class="error-title">页面不存在</h1>
      <p class="error-message">抱歉，您访问的页面不存在或已被删除</p>
      <div class="action-buttons">
        <el-button type="primary" @click="goBack">返回上一页</el-button>
        <el-button @click="goHome">返回首页</el-button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.not-found-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(
      rgba(255, 224, 130, 0.82),
      rgba(255, 213, 79, 0.82)
    ),
    url("https://images.pexels.com/photos/70497/pexels-photo-70497.jpeg?auto=compress&w=900&q=80")
      center center/cover no-repeat;
}

.not-found-content {
  text-align: center;
  padding: 3rem;
  background: rgba(255, 245, 200, 0.97);
  border-radius: 24px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);
  border: 2.5px solid #90caf9;
  max-width: 500px;
}

.error-code {
  font-size: 6rem;
  font-weight: bold;
  color: #ff9800;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 2rem;
  color: #d2691e;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.2rem;
  color: #a05a1c;
  margin-bottom: 2rem;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
</style>
